package com.wzcl.app.model.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
public class KnowledgePointDto extends BaseDto {

    @NotNull(message = "年级Id不能为空")
    @ApiModelProperty(name = "年级id")
    private Integer gradeId;

    @NotNull(message = "学科Id不能为空")
    @ApiModelProperty(name = "学科Id")
    private Integer subjectId;

    @NotBlank(message = "章节不能为空")
    @ApiModelProperty(name = "章节")
    private  String  chapter;

    @NotBlank(message = "知识点不能为空")
    @ApiModelProperty(name = "知识点")
    private  String  point;

    public boolean isValid(){
        return gradeId != null
                && subjectId != null
                && StringUtils.isNotBlank(chapter)
                && StringUtils.isNotBlank(point);
    }
}
